package cn.itcast.bos.web.action.base;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

import cn.itcast.bos.Service.base.StandardService;
import cn.itcast.bos.domain.base.Standard;

/**
 * 取派标准action
 * */
@ParentPackage("struts-default")
@Namespace("/")
@Action
@Controller
@Scope("prototype")
public class StandardAction extends ActionSupport implements ModelDriven<Standard>{

	//模型驱动
	private Standard standard = new Standard();
	@Override
	public Standard getModel() {
		// TODO Auto-generated method stub
		return standard;
	}
	
	@Autowired
	private StandardService standardService;
	/**
	 * 进行取派信息的保存
	 * */
	@Action(value="standard_save",results={@Result(name="success",location="/pages/base/standard.html",type="redirect")})
	public String save(){
		System.out.println("保存系统已经开启....");
		standardService.save(standard);
		return SUCCESS;
	}

	
}
